package com.androidbook.triviaquiz6;

import android.content.res.Resources;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class QuizSplashActivity extends QuizActivity {
	/** Called when the activity is first created. */
	int pressCount = 5;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.atemplayout);
		Resources resources = getResources();
		String msg = resources.getString(R.string.the_temp_String, pressCount);

		final Button myButton = (Button) findViewById(R.id.button1);
		TextView text = (TextView) findViewById(R.id.textView1);
		text.setText(msg);

		myButton.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				pressCount++;
				System.out.println(pressCount);
				TextView text = (TextView) findViewById(R.id.textView1);
				String msg = getResources().getString(R.string.the_temp_String,
						pressCount);
				text.setText(msg);

			}
		});
	}
}